<div class="bjui-row col-1">
    <label class="row-label">旧密码</label>
    <div class="row-input required">
        <input type="text" name="oldPassword" id="oldPassword" data-rule="required">
    </div>
    <label class="row-label">新密码</label>
    <div class="row-input required">
        <input type="text" name="newPassword" id="newPassword" data-rule="required">
    </div>
    <label class="row-label">重复新密码</label>
    <div class="row-input required">
        <input type="text" name="newPassword2" id="newPassword2" data-rule="required">
    </div>
    <div>
        <button onclick="commit()" class="btn-green">确定</button>
    </div>
</div>
<script>
    function commit() {
        var oldPassword = $("#oldPassword").val();
        var newPassword = $("#newPassword").val();
        var newPassword2 = $("#newPassword2").val();
        var moduledata = new Object();
        moduledata.oldPassword = oldPassword;
        moduledata.newPassword = newPassword;
        moduledata.newPassword2 = newPassword2;
        $.ajax({
            type: "POST",
            url: "/sysmanage/editpassword.do",
            data: JSON.stringify(moduledata),
            cache: true,
            contentType: "application/json",
            async: false,
            dataType: 'JSON',
            success: function (data) {
                if (data.status == "ok") {
                    BJUI.alertmsg(data.status, data.content, {
                        okCall: function () {
                            location.reload();
                        },
                        autoClose: false,
                        mask: false
                    });
                }
                else {
                    BJUI.alertmsg(data.status, data.content);
                }
            }
        })
    }


</script>